#ifndef UINAVIGATOR_HPP
#define UINAVIGATOR_HPP

#include "ListDefine.h"


struct ThumbListItemInfo
{
	bool folder;
	bool empty;
	DString id;
	DString logo;
	DString text1;
	DString text2;
	DString text3;
	void*      pData;
};

class CNavigatorUI : public CListUI, public IDialogBuilderCallback
{
public:
	enum {SCROLL_TIMERID = 10};

	CNavigatorUI(CPaintManagerUI& paint_manager);

	~CNavigatorUI();

	//LPCTSTR GetWindowClassName() const { return _T("Navigator"); };
	//UINT GetClassStyle() const { return CS_DBLCLKS; };

	LPCTSTR GetClass() const;

	bool Add(CControlUI* pControl);

	bool AddAt(CControlUI* pControl, int iIndex);

	bool Remove(CControlUI* pControl, bool bDoNotDestroy=false);

	bool RemoveAt(int iIndex, bool bDoNotDestroy=false);

	void RemoveAll();

	void DoEvent(TEventUI& event);

	Node* GetRoot();

	void SetRoot(Node* root);

	Node* AddNode(const ThumbListItemInfo& item, Node* parent = NULL);
	Node* AddNode(Node* node, Node* parent = NULL, int idx=0);

	bool RemoveNode(Node* node);

	void SetChildVisible(Node* node, bool visible);

	bool CanExpand(Node* node) const;

	virtual CControlUI* CreateControl(LPCTSTR pstrClass);

	void HightLightNode(Node* node, CBaseImage* pImg);

	DString GetLevelName(int level);

private:
	Node*	m_pRootNode;
	LONG	m_dwDelayDeltaY;
	DWORD	m_dwDelayNum;
	DWORD	m_dwDelayLeft;
	CDuiRect	m_rcPadding;
	DString m_expandImage;
	DString m_collapseImage;
	CPaintManagerUI& m_pm;
	bool   m_needDel;
	vector<Node*> m_HLNode;

};


#endif // UINAVIGATOR_HPP